package wayic.utunes.events;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author ashesh .nishant @ gmail . com
 *
 */
public abstract class AsynchTrackAdapter implements TrackListener{

    private static final  ExecutorService executor = Executors.newCachedThreadPool();
    
    @Override
    public void paused(final TrackEvent event) {
        executor.submit(new Runnable(){
           public void run(){
               trackPaused(event);
           }
        });
        
    }

    @Override
    public void resumed(final TrackEvent event) {
        executor.submit(new Runnable(){
            public void run(){
                trackResumed(event);
            }
        });
        
    }

    @Override
    public void started(final TrackEvent event) {
        executor.submit(new Runnable(){
            public void run(){
                trackStarted(event);
            }
        });
    }

    @Override
    public void stopped(final TrackEvent event) {
        executor.submit(new Runnable(){
            public void run(){
                trackStopped(event);
            }
        });
    }
    
    public void trackPaused(final TrackEvent event){}
    public void trackStarted(final TrackEvent event){}
    public void trackResumed(final TrackEvent event){}
    public void trackStopped(final TrackEvent event){}
}
